#ifndef _CRT_PATH_H_
#define _CRT_PATH_H_

#include <crt_core.hpp>

#ifdef __cplusplus
extern "C" {
#endif

#if (TARGET_OS == OS_WIN)
typedef size_t pathlen;
#elif (TARGET_OS == OS_POSIX)
typedef size_t pathlen;
#elif (TARGET_OS == OS_MACH)
typedef uint32_t pathlen;
#elif (TARGET_OS == OS_UNIX)
typedef size_t pathlen;
#endif

int fileisexist(const basic_tchar* file);
int fileisdirectory(const basic_tchar* dir);
int get_dynamicpath(void* name, basic_tchar* path, size_t len);
int get_executepath(_pid_t pid, basic_tchar* path, pathlen len);
int get_dynamicname(const basic_tchar* name, basic_tchar* pluginame, size_t len);
typedef void (*get_file_cb)(const basic_tchar* path, void* ctx);
int get_files(basic_tchar* path, get_file_cb entry, void* ctx);

#ifdef __cplusplus
}
#endif

#endif
